package com.zdya.combatdocuments.controller;

import com.zdya.combatdocuments.entity.vo.ResultVo;
import com.zdya.combatdocuments.service.MindMapService;
import com.zdya.combatdocuments.util.ResultVoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * * @author: bj
 * * @date: 2023/6/5
 * * @desc: 思维导图
 */
@RestController
@RequestMapping("/documents/mindMap")
public class MindMapController {

    @Autowired
    private MindMapService mindMapService;

    /**
     * @desc 思维导图查询
     * @return
     */
    @GetMapping("/viewMindMap")
    public ResultVo viewMindMap() {
        return ResultVoUtil.success(mindMapService.queryMindMapInfo());
    }

    /**
     * 思维导图导出excel
     */
    @GetMapping("/exportMindMap")
    public void exportMindMap(HttpServletResponse response) throws IOException {
        mindMapService.exportMindMap(response);
    }

}
